home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / gui / GadEd20Demo.lha / C / TestMain.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-11  |  1.7 KB  |  77 lines

  1. /* Test für den GadEd C-Source */
  2.  
  3. #include "unbekannt.h"
  4. #include <exec/types.h>
  5. #include <intuition/screens.h>
  6. #include <libraries/gadtools.h>
  7. #include <proto/intuition.h>
  8. #include <proto/gadtools.h>
  9. #include <proto/exec.h>
  10.  
  11. struct Screen        *S;
  12. struct Window        *Wi;
  13. struct Gadget        *TempGadget;
  14. struct IntuiMessage    *Message;
  15. WORD            ID;
  16. UWORD            Code;
  17. ULONG            Cla;
  18. BOOL            OK;
  19.  
  20. static struct TagItem STags[] = {
  21.  SA_Title,(ULONG)"User Tag Test *************",
  22. /* SA_Top,5,
  23.  SA_Left,10, */
  24.  TAG_DONE,0
  25. };
  26.  
  27. static struct TagItem WTags[] = {
  28.  WA_Title,(ULONG)"Window **********",
  29. /* WA_Activate,FALSE,
  30.  WA_SizeGadget,TRUE,
  31.  WA_MinWidth,40,
  32.  WA_MinHeight,30,
  33.  WA_MaxWidth,(ULONG)-1,
  34.  WA_MaxHeight,(ULONG)-1, */
  35.  TAG_DONE,0
  36. };
  37.  
  38. void main(void)
  39. {
  40.    S=LockPubScreen(NULL);
  41.    if (InitUnbekannt(S ,&STags[0] )) {
  42.  
  43.       Wi=InitProc00Mask(&WTags[0]);
  44.       if (Wi) {
  45.          do {
  46.             do {
  47.                WaitPort(Wi->UserPort);
  48.                Message=GT_GetIMsg(Wi->UserPort);
  49.             } while (Message==NULL);
  50.             Cla  = Message->Class;
  51.             Code = Message->Code;
  52.             TempGadget = Message->IAddress;
  53.             GT_ReplyIMsg(Message);
  54.          } while (IDCMP_CLOSEWINDOW != Cla);
  55.          CloseProc00Mask();
  56.       }
  57.  
  58.       Wi=InitProc00Mask(&WTags[0]);
  59.       if (Wi) {
  60.          do {
  61.             do {
  62.                WaitPort(Wi->UserPort);
  63.                Message=GT_GetIMsg(Wi->UserPort);
  64.             } while (Message==NULL);
  65.             Cla  = Message->Class;
  66.             Code = Message->Code;
  67.             TempGadget = Message->IAddress;
  68.             GT_ReplyIMsg(Message);
  69.          } while (IDCMP_CLOSEWINDOW != Cla);
  70.          CloseProc00Mask();
  71.       }
  72.  
  73.       FreeUnbekannt();
  74.    }
  75.    UnlockPubScreen(NULL,S);
  76. }
  77.